<?php
namespace Admin\Model;
use Think\Model;
class SettingModel extends Model {

	protected $tableName = 'setting'; 
	protected $_validate = array(
	);

	public function msave() {
		$post = $this->getpost();
		$msg = $this->where('id = 1')->save($post);
		return $msg;
	}

	/**
	 * 接收过滤数据
	 */
	protected function getpost() {
		if(isset($_POST['title'])) {
		$data['title'] = I('post.title','','strip_tags');
		}

		if(isset($_POST['tel'])) {
		$data['tel'] = I('post.tel','','strip_tags');
		}

		if(isset($_POST['address'])) {
		$data['address'] = I('post.address','','strip_tags');
		}

		if(isset($_POST['prize'])) {
		$data['prize'] = I('post.prize','','int');
		}

		return $data;
	}

}
